* NOTE: You need to set the Stata working directory to the path
* where the data file is located.

set more off

clear
quietly infix                   ///
  str     year       1-9        ///
  str     regiona    10-10      ///
  str     divisiona  11-11      ///
  str     state      12-35      ///
  str     statea     36-37      ///
  str     county     38-94      ///
  str     countya    95-97      ///
  str     cousuba    98-102     ///
  str     placea     103-107    ///
  str     aianhha    108-111    ///
  str     anrca      112-116    ///
  str     cbsaa      117-121    ///
  str     csaa       122-124    ///
  str     metdiva    125-129    ///
  str     nectaa     130-134    ///
  str     cnectaa    135-137    ///
  str     nectadiva  138-142    ///
  str     uaa        143-147    ///
  str     cdcurra    148-149    ///
  str     sdelma     150-154    ///
  str     sdseca     155-159    ///
  str     sdunia     160-164    ///
  str     puma5a     165-169    ///
  str     name_e     170-369    ///
  double  ksle001    370-378    ///
  double  ksle002    379-387    ///
  double  ksle003    388-396    ///
  double  ksle004    397-405    ///
  double  ksle005    406-414    ///
  double  ksle006    415-423    ///
  double  ksle007    424-432    ///
  double  ksle008    433-441    ///
  double  ksle009    442-450    ///
  double  ksle010    451-459    ///
  double  ksle011    460-468    ///
  double  ksle012    469-477    ///
  double  ksle013    478-486    ///
  double  ksle014    487-495    ///
  double  ksle015    496-504    ///
  double  ksle016    505-513    ///
  double  ksle017    514-522    ///
  double  ksle018    523-531    ///
  double  ksle019    532-540    ///
  double  ksle020    541-549    ///
  double  ksle021    550-558    ///
  double  ksle022    559-567    ///
  double  ksle023    568-576    ///
  double  ksle024    577-585    ///
  double  ksle025    586-594    ///
  str     name_m     595-794    ///
  double  kslm001    795-803    ///
  double  kslm002    804-812    ///
  double  kslm003    813-821    ///
  double  kslm004    822-830    ///
  double  kslm005    831-839    ///
  double  kslm006    840-848    ///
  double  kslm007    849-857    ///
  double  kslm008    858-866    ///
  double  kslm009    867-875    ///
  double  kslm010    876-884    ///
  double  kslm011    885-893    ///
  double  kslm012    894-902    ///
  double  kslm013    903-911    ///
  double  kslm014    912-920    ///
  double  kslm015    921-929    ///
  double  kslm016    930-938    ///
  double  kslm017    939-947    ///
  double  kslm018    948-956    ///
  double  kslm019    957-965    ///
  double  kslm020    966-974    ///
  double  kslm021    975-983    ///
  double  kslm022    984-992    ///
  double  kslm023    993-1001   ///
  double  kslm024    1002-1010  ///
  double  kslm025    1011-1019  ///
  using `"nhgis0050_ds180_20103_2010_county.dat"'


format ksle001   %9.0f
format ksle002   %9.0f
format ksle003   %9.0f
format ksle004   %9.0f
format ksle005   %9.0f
format ksle006   %9.0f
format ksle007   %9.0f
format ksle008   %9.0f
format ksle009   %9.0f
format ksle010   %9.0f
format ksle011   %9.0f
format ksle012   %9.0f
format ksle013   %9.0f
format ksle014   %9.0f
format ksle015   %9.0f
format ksle016   %9.0f
format ksle017   %9.0f
format ksle018   %9.0f
format ksle019   %9.0f
format ksle020   %9.0f
format ksle021   %9.0f
format ksle022   %9.0f
format ksle023   %9.0f
format ksle024   %9.0f
format ksle025   %9.0f
format kslm001   %9.0f
format kslm002   %9.0f
format kslm003   %9.0f
format kslm004   %9.0f
format kslm005   %9.0f
format kslm006   %9.0f
format kslm007   %9.0f
format kslm008   %9.0f
format kslm009   %9.0f
format kslm010   %9.0f
format kslm011   %9.0f
format kslm012   %9.0f
format kslm013   %9.0f
format kslm014   %9.0f
format kslm015   %9.0f
format kslm016   %9.0f
format kslm017   %9.0f
format kslm018   %9.0f
format kslm019   %9.0f
format kslm020   %9.0f
format kslm021   %9.0f
format kslm022   %9.0f
format kslm023   %9.0f
format kslm024   %9.0f
format kslm025   %9.0f

label var year      `"Data File Year"'
label var regiona   `"Region Code"'
label var divisiona `"Division Code"'
label var state     `"State Name"'
label var statea    `"State Code"'
label var county    `"County Name"'
label var countya   `"County Code"'
label var cousuba   `"County Subdivision Code"'
label var placea    `"Place Code"'
label var aianhha   `"American Indian Area/Alaska Native Area/Hawaiian Home Land Code"'
label var anrca     `"Alaska Native Regional Corporation Code"'
label var cbsaa     `"Metropolitan Statistical Area/Micropolitan Statistical Area Code"'
label var csaa      `"Combined Statistical Area Code"'
label var metdiva   `"Metropolitan Division Code"'
label var nectaa    `"New England City and Town Area Code"'
label var cnectaa   `"Combined New England City and Town Area Code"'
label var nectadiva `"New England City and Town Area Division Code"'
label var uaa       `"Urban Area Code"'
label var cdcurra   `"Congressional District (111th Congress) Code"'
label var sdelma    `"School District (Elementary)/Remainder Code"'
label var sdseca    `"School District (Secondary)/Remainder Code"'
label var sdunia    `"School District (Unified)/Remainder Code"'
label var puma5a    `"Public Use Microdata Sample Area (PUMA) Code"'
label var name_e    `"Estimates: Area Name"'
label var ksle001   `"Estimates: Total"'
label var ksle002   `"Estimates: No schooling completed"'
label var ksle003   `"Estimates: Nursery school"'
label var ksle004   `"Estimates: Kindergarten"'
label var ksle005   `"Estimates: 1st grade"'
label var ksle006   `"Estimates: 2nd grade"'
label var ksle007   `"Estimates: 3rd grade"'
label var ksle008   `"Estimates: 4th grade"'
label var ksle009   `"Estimates: 5th grade"'
label var ksle010   `"Estimates: 6th grade"'
label var ksle011   `"Estimates: 7th grade"'
label var ksle012   `"Estimates: 8th grade"'
label var ksle013   `"Estimates: 9th grade"'
label var ksle014   `"Estimates: 10th grade"'
label var ksle015   `"Estimates: 11th grade"'
label var ksle016   `"Estimates: 12th grade, no diploma"'
label var ksle017   `"Estimates: Regular high school diploma"'
label var ksle018   `"Estimates: GED or alternative credential"'
label var ksle019   `"Estimates: Some college, less than 1 year"'
label var ksle020   `"Estimates: Some college, 1 or more years, no degree"'
label var ksle021   `"Estimates: Associate's degree"'
label var ksle022   `"Estimates: Bachelor's degree"'
label var ksle023   `"Estimates: Master's degree"'
label var ksle024   `"Estimates: Professional school degree"'
label var ksle025   `"Estimates: Doctorate degree"'
label var name_m    `"Margins of error: Area Name"'
label var kslm001   `"Margins of error: Total"'
label var kslm002   `"Margins of error: No schooling completed"'
label var kslm003   `"Margins of error: Nursery school"'
label var kslm004   `"Margins of error: Kindergarten"'
label var kslm005   `"Margins of error: 1st grade"'
label var kslm006   `"Margins of error: 2nd grade"'
label var kslm007   `"Margins of error: 3rd grade"'
label var kslm008   `"Margins of error: 4th grade"'
label var kslm009   `"Margins of error: 5th grade"'
label var kslm010   `"Margins of error: 6th grade"'
label var kslm011   `"Margins of error: 7th grade"'
label var kslm012   `"Margins of error: 8th grade"'
label var kslm013   `"Margins of error: 9th grade"'
label var kslm014   `"Margins of error: 10th grade"'
label var kslm015   `"Margins of error: 11th grade"'
label var kslm016   `"Margins of error: 12th grade, no diploma"'
label var kslm017   `"Margins of error: Regular high school diploma"'
label var kslm018   `"Margins of error: GED or alternative credential"'
label var kslm019   `"Margins of error: Some college, less than 1 year"'
label var kslm020   `"Margins of error: Some college, 1 or more years, no degree"'
label var kslm021   `"Margins of error: Associate's degree"'
label var kslm022   `"Margins of error: Bachelor's degree"'
label var kslm023   `"Margins of error: Master's degree"'
label var kslm024   `"Margins of error: Professional school degree"'
label var kslm025   `"Margins of error: Doctorate degree"'


